﻿using IntelligentAgriculture.Contracts.Interface;
using IntelligentAgriculture.Services.StartServices;
using IntelligentAgriculture.WebAPI.Application.Command.GermlineHistoryRecordsCommand;
using IntelligentAgriculture.WebAPI.Application.Command.StartCommand;
using MediatR;

namespace IntelligentAgriculture.WebAPI.Application.CommandHandler.GermlineHistoryRecordsCommandHandler
{
    /// <summary>
    /// 种母历史记录批量删除CommandHandler
    /// </summary>
    public class DeleteRangeHistoryRecordCommandHander : IRequestHandler<DeleteRangeHistoryRecordCommand, Results<int>>
    {


        private readonly IHistoryRecordService _service;
        public DeleteRangeHistoryRecordCommandHander(IHistoryRecordService service)
        {
            _service = service;
        }




        public async Task<Results<int>> Handle(DeleteRangeHistoryRecordCommand request, CancellationToken cancellationToken)
        {
            var list = await _service.DeleteRangeHistoryrecord(request.HRIds);
            return Results<int>.DataResult(list);
        }










    }
}
